<template>
	<view>
		<view class="margin_content wid90 mar">
			<view style="height: 20rpx;"></view>
			<view class="textCen foSi30 fowe600 mar-bott20">{{title}}</view>
			<rich-text :nodes="data"></rich-text>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				data:'',
				type:'',
				
			}
		},
		onLoad(options) {
			this.title = options.title
			this.type = options.type
			this.list()
		},
		methods: {
			list(){
				var that = this
				uni.request({
					url: that.global.url+'/api/qianyu_petrol/gasstation_agreement',
					method: 'POST',
					header: {
						'site-id': that.global.site_id,
						"token": uni.getStorageSync('token')
					},
					data: {
						type: that.type
					},
					success: (res) => {
						let result = res.data
						if (result.code == 1) {
							var data = result.data
							data = data.replace(/<img/gi, "<img class='richImg'");
							that.data = data
						} else {
							uni.showToast({
								title: result.msg,
								icon: 'error'
							})
						}
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
		}
	}
</script>

<style>
	.richImg {
	    width: 100% !important;
	    height: auto !important;
	}
</style>
